<?php 
class Content
{
	public $Body;
	
	public $ContentID;
	public $StaticID;
	public $StaticHTML;
	
	public function Content($katana, $theme) 
	{ 
		if($katana->HtmlID > 0)
		{
			self::setStaticID($katana->HtmlID);
			self::loadStaticHTML();
		}
		if($katana->ContentID > 0)
		{ self::setContentID($katana->ContentID); }
	}
	
	public function getContentID() { return $this->ContentID; }
	public function getStaticID() { return $this->StaticID; }
	public function getStaticHTML() { return $this->StaticHTML; }
	
	public function setContentID($val) { $this->ContentID=$val; }
	public function setStaticID($val) { $this->StaticID=$val; }
	public function setStaticHTML($val) { $this->StaticHTML=$val; }
	
	public function loadStaticHTML()
	{
		if($this->StaticID > 0)
		{
			$result = mysql_query('SELECT html FROM '.DB_PERFIX.'sitemap_static_html WHERE parent_id='.$this->StaticID.' LIMIT 1;');
			if($result)
			{
				while($row = mysql_fetch_array($result))
				{ self::setStaticHTML($row['html']); }
			}
		}
	}
}
?>